<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>数据指标管理</title>
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/dtree.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/font/dtreefont.css"/>
    <link rel="stylesheet" href="../../assets/libs/ztree/css/zTreeStyle/zTreeStyle.css">
    <link rel="stylesheet" href="../../assets/module/admin.css?v=313"/>
    <link rel="stylesheet" href="../../assets/css/publicStyle.css"/>
    <link rel="stylesheet" href="../../assets/css/micro/template.css"/>
    <!--[if lt IE 9]>
    <script src="../../assets/libs/html5shiv.min.js"></script>
    <script src="../../assets/libs/respond.min.js"></script>
    <![endif]-->
    <script src="../../assets/libs/template-web.js"></script>
    <style>
        #AddTemplateIdenForm{
            padding: 25px;
        }
        .text-right{
            margin-top: 15px;
        }
    </style>
</head>
<body>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <!-- 左表 -->
        <div class=" layui-col-sm12 layui-col-md3 layui-col-lg3">
            <div class="layui-card">
                <div class="layui-card-header">汇总指标目录</div>
                <div class="layui-card-body" >
                    <div id="template-iden-tmpl-box"></div>
                    <ul id="treeTbTree" class="ztree" ></ul>
                </div>
            </div>
        </div>
        <!-- 右树 -->
        <div class="layui-col-sm12 layui-col-md9 layui-col-lg9">
            <div class="layui-card">
                <div class="layui-card-header">汇总指标管理</div>
                <div class="layui-card-body mini-bar" >
                    <div id="template-idenManage-tmpl-box"></div>
                    <div id="page-box"></div>
                    <table class="layui-table" id="identGroupTable" lay-filter="identGroupTable" lay-skin="nob"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 新增指标目录弹窗 -->
<script type="text/html" id="AddTemplateIdenModel">
    <form id="AddTemplateIdenForm" lay-filter="addGroupForm" class="layui-form model-form ">
        <input name="userId" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label">目录名称</label>
            <div class="layui-input-block">
                <input name="idenName" placeholder="请输入目录名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">添加到目录</label>
            <div class="layui-input-block">
                <input name="nickName" id="choose_menu" placeholder="" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" disabled/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选择目录</label>
            <div class="layui-input-block">
                <ul id="menuTree" class="ztree" ></ul>
            </div>
        </div>
<!--        <div class="layui-form-item layui-form-text">-->
<!--            <label class="layui-form-label">状态:</label>-->
<!--            <div class="layui-input-block">-->
<!--                <input type="checkbox" name="zzz" lay-skin="switch" lay-text="可用|不可用">-->
<!--            </div>-->
<!--        </div>-->
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn layui-btn-sm" lay-filter="getAddMenuData" lay-submit >确定</button>
        </div>
    </form>
</script>

<!-- 修改指标目录弹窗 -->
<script type="text/html" id="editIdenMenuModel">
    <form id="editIdenMenuForm" lay-filter="editIdenMenuForm" class="layui-form model-form ">
        <input name="userId" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label">目录名称</label>
            <div class="layui-input-block">
                <input name="idenName" placeholder="请输入目录名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
<!--        <div class="layui-form-item layui-form-text">-->
<!--            <label class="layui-form-label">状态:</label>-->
<!--            <div class="layui-input-block">-->
<!--                <input type="checkbox" name="zzz" lay-skin="switch" lay-text="可用|不可用">-->
<!--            </div>-->
<!--        </div>-->
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn layui-btn-sm" lay-filter="editMenuData" lay-submit >确定</button>
        </div>
    </form>
</script>

<!-- 新增指标弹窗 -->
<script type="text/html" id="model-add-idenManage">
    <form id="addIdenManageForm" lay-filter="editGroupForm" class="layui-form model-form">
        <input name="userId" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label">指标名称</label>
            <div class="layui-input-block">
                <input name="idenName" placeholder="请输入指标名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标全称</label>
            <div class="layui-input-block">
                <input name="allName" placeholder="请输入指标全称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标类型</label>
            <div class="layui-input-block">
                <select name="idenType" placeholder="请选择指标类型">
                    <option value="2">数字</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标长度</label>
            <div class="layui-input-block">
                <input name="idenLength" placeholder="请输入指标长度" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标精度</label>
            <div class="layui-input-block">
                <input name="idenPrecision" placeholder="请输入指标精度" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标来源</label>
            <div class="layui-input-block">
                <select name="dataProcurement" placeholder="请选择指标来源" id="addInFlow">
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">使用方式</label>
            <div class="layui-input-block">
                <select name="dataUse" placeholder="请选择使用方式" id="addFlowOut">
                    <option value="文本">年</option>
                    <option value="数字">xxx</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">指标描述</label>
            <div class="layui-input-block">
                        <textarea name="memo" placeholder="请输入指标描述信息" class="layui-textarea"
                                  lay-verType="tips" lay-verify="required" required></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">上级节点</label>
            <div class="layui-input-block">
                <input id="addPrevName" name="nickName" placeholder="" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" disabled/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选择上级节点</label>
            <div class="layui-input-block">
                <ul id="addIdenTree" class="ztree" ></ul>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标状态</label>
            <div class="layui-input-block">
                <input type="checkbox" checked name="status" lay-skin="switch" lay-text="是|否">
            </div>
        </div>

        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn layui-btn-sm" lay-filter="addIdenDataList" lay-submit >确定</button>
        </div>
    </form>
</script>

<!--渲染流入方式-->
<script type="text/tmpl" id="template-inflow-tmpl">
    <option value=""></option>
     {{each inflowData}}
        <option value="{{$value.value}}">{{$value.procurement_type}}</option>
    {{/each}}

</script>
<!--渲染流出方式-->
<script type="text/tmpl" id="template-flowOut-tmpl">
    <option value=""></option>
     {{each flowOutData}}
        <option value="{{$value.value}}">{{$value.use_type}}</option>
    {{/each}}

</script>

<!-- 编辑指标弹窗 -->
<script type="text/html" id="model-edit-idenManage">
    <form id="editIdenManageForm" lay-filter="editGroupForm" class="layui-form model-form">
        <input name="userId" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label">指标名称</label>
            <div class="layui-input-block">
                <input name="idenName" placeholder="请输入指标名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标全称</label>
            <div class="layui-input-block">
                <input name="allName" placeholder="请输入指标全称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标类型</label>
            <div class="layui-input-block">
                <select name="idenType" placeholder="请选择指标类型">
                    <option value="2">数字</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标长度</label>
            <div class="layui-input-block">
                <input name="idenLength" placeholder="请输入指标长度" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标精度</label>
            <div class="layui-input-block">
                <input name="idenPrecision" placeholder="请输入指标精度" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">指标来源</label>
            <div class="layui-input-block">
                <select name="dataProcurement" placeholder="请选择指标来源" id="editPrecision">

                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">使用方式</label>
            <div class="layui-input-block">
                <select name="dataUse" placeholder="请选择使用方式" id="editUseTyoe">
                    <option value="文本">年</option>
                    <option value="数字">xxx</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">指标描述</label>
            <div class="layui-input-block">
                        <textarea name="memo" placeholder="请输入指标描述信息" class="layui-textarea"
                                  lay-verType="tips" lay-verify="required" required></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">上级节点</label>
            <div class="layui-input-block">
                <input name="nickName" id="editPrevName" placeholder="" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" disabled/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选择上级节点</label>
            <div class="layui-input-block">
                <ul id="editIdenTree" class="ztree" ></ul>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">指标状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" lay-skin="switch" lay-text="可用|不可用">
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn layui-btn-sm" lay-filter="editIdenDataList" lay-submit >确定</button>
        </div>
    </form>
</script>

<!--渲染流入方式-->
<script type="text/tmpl" id="template-editinflow-tmpl">
    <option value=""></option>
     {{each inflowData}}
        <option value="{{$value.value}}">{{$value.procurement_type}}</option>
    {{/each}}

</script>
<!--渲染流出方式-->
<script type="text/tmpl" id="template-editflowOut-tmpl">
    <option value=""></option>
     {{each flowOutData}}
        <option value="{{$value.value}}">{{$value.use_type}}</option>
    {{/each}}

</script>
<!-- 分组版本管理弹窗 -->
<script type="text/html" id="mode-version-Group">
    <form id="versionGroupForm" lay-filter="versionGroupForm" class="layui-form model-form">
        <div class="layui-form-item layui-row">
            <div class="layui-inline layui-col-md12">
                <label class="layui-form-label">版本值</label>
                <div class="layui-input-block">
                    <input name="ckName" type="text" placeholder="请输入版本值" class="layui-input"
                           lay-verType="tips" lay-verify="required" required/>
                </div>
                <label class="layui-form-label">版本备注</label>
                <div class="layui-input-block">
                    <input name="ckYm" type="text" placeholder="请输入版本备注" class="layui-input"
                           lay-verType="tips" lay-verify="required" required/>
                </div>
                <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="addVersion">添加版本</button>
            </div>
        </div>
    </form>
    <div class="layui-form-item layui-row mode-version-table" >
        <table class="layui-table" id="identGroupVersionTable" lay-filter="identGroupVersionTable" lay-skin="nob"></table>
    </div>
</script>

<!--渲染指标管理权限-->
<script type="text/tmpl" id="template-idenManage-tmpl">
    <div class="layui-form toolbar">
        <div class="layui-form-item">
            <div class="layui-inline">
                {{ if hasPower("/macro/iden-value:add")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="add-btn-template-idenManage" >
                    <i class="layui-icon">&#xe654;</i>新增
                </button>
                {{/if}}
            </div>
        </div>
    </div>
  </script>

<!-- 分组表格操作列DOM -->
<script id="ident-template-idenManage-box">
</script>
<!-- 指标管理表格操作列 -->
<script type="text/tmpl" id="ident-template-idenManage-tmp">
    {{ if hasPower("/macro/iden-value:edit")}}
    <a class="layui-btn layui-btn-xs layui-btn-warning" lay-event="edit">编辑</a>
    {{/if}}
    {{ if hasPower("/macro/iden-value:delete")}}
    <a class="layui-btn layui-btn-danger layui-btn-xs micro-ident-group-delete" lay-event="delete">删除</a>
    {{/if}}
</script>

<!--渲染指标目录权限-->
<script type="text/tmpl" id="template-iden-tmpl">
     <div class="layui-form toolbar">
        <div class="layui-form-item">
            <div class="layui-inline">
                 <div class="layui-inline">
                {{if hasPower("/macro/iden-menu:add")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="addTemplateIdenBtn">
                    <i class="layui-icon">&#xe654;</i>新增
                </button>
                {{/if}}
                {{if hasPower("/macro/iden-menu:edit")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="editTemplateIdenBtn">
                    <i class="layui-icon">&#xe642;</i>编辑
                </button>
                {{/if}}
                {{if hasPower("/macro/iden-menu:delete")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="deleteTemplateIdenBtn">
                    <i class="layui-icon">&#xe640;</i>删除
                </button>
                {{/if}}
                </div>
            </div>
        </div>
     </div>
</script>

<!-- js部分 -->
<script type="text/javascript" src="../../assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="../../assets/js/common.js?v=313"></script>
<script src="../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
<!-- Ztree树部分 -->
<script src="../../assets/libs/ztree/js/jquery.ztree.core.min.js"></script>
<script src="../../assets/libs/ztree/js/jquery.ztree.exedit.js"></script>
<script src="../../assets/libs/ztree/js/jquery.ztree.excheck.min.js"></script>

<script src="../../assets/libs/template-web.js"></script>
<script src="../../assets/libs/axios.min.js"></script>
<script src="../../assets/js/config.js"></script>
<script src="../../assets/js/authority.js"></script>

<script type="text/javascript" src="../../assets/js/macro/idenManage.js"></script>
<script type="text/javascript" src="../../assets/js/config/idenManageData.js"></script>
</body>

</html>